DELETE FROM `table` WHERE (SELECT COUNT(*) FROM `table` WHERE `idu` = 1) > 5 AND `idu` = 1 LIMIT 3
DELETE FROM `table` WHERE `idu` = 1 AND `time_end` NOT IN
(SELECT `time_end` FROM `table` ORDER BY `time_end` DESC LIMIT 3)
DELETE FROM `table` WHERE `idu` = 1 AND `time_end` <
(SELECT * FROM (SELECT `time_end` FROM `table` ORDER BY `time_end` DESC LIMIT 3) as T
ORDER BY `time_end` LIMIT 1)