$query .= " ON DUPLICATE KEY UPDATE first_name = VALUES(`first_name`), last_name = VALUES(`last_name`), login = VALUES(`login`)";
INSERT INTO `users` (id,first_name,last_name,login) VALUES (142,Николай,Киселёв,erwrerew),(143,Яна,Степанова,stepanova)ON DUPLICATE KEY UPDATE first_name = VALUES(first_name), last_name = VALUES(last_name), login = VALUES(login)