Thanks for your replies. Finally I found the error. That's how the structure should look like:
CREATE TABLE IF NOT EXISTS `table_test` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`external_id` int(10) NOT NULL,
`x` int(5) NOT NULL,
`y` int(5) NOT NULL,
`z` int(5) NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY (`external_id`,`name`) # ----- this line was changed
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;