DELETE FROM `spell_chain` WHERE `spell_id` IN (5487,9634,33943,40120);

INSERT INTO `spell_chain` VALUES
(5487,0,5487,1),
(9634,5487,5487,2),
(33943,0,33943,1),
(40120,33943,33943,2);
