Byłoby to coś takiego: delete t from loginsystem t where premium = '1 DAY' and created_at < now() - interval 1 day;