SELECT *
FROM `tasks`
WHERE `nextStartTime` < :currentTime;
DELETE
FROM `tasks`
WHERE `nextStartTime` < :currentTime AND 0 = `interval`;
UPDATE `tasks`
SET `nextStartTime` = `nextStartTime` + INTERVAL `interval` MINUTE
WHERE `nextStartTime` < :currentTime;