The problem is with the condition syntax; it looks like below and performs a binary comparison:
$query->condition($field, $value = NULL, $operator = '=')
There are several issues, there is no field dataReg + 5 MINUTES
and it likely won't have the literal value NOW()
either. Besides, since you omitted the operator, the query would (if it had worked) only select items that are exactly 5 minutes old.
You are looking for a way to execute SQL in the query instead, which is provided by the where
clause:
$query->where($snippet, $args = array())
In your case, it would probably look like this:
$deleteOldRows = db_delete('reserves')
->condition('entityId', -1)
->where('`dataReg` + 5 MINUTES < :time', array(':time' => 'NOW()'))
->execute();
You can find some good information on conditional clauses here: https://www.drupal.org/docs/7/api/database-api/dynamic-queries/conditional-clauses
UPDATE
It appears I was wrong and this can be done with conditions after all, you should just reverse the logic. Rather than adding 5 minutes to the date, subtract 5 minutes from now.
$query->condition('dataReg', $adjusted_date, '<=')
Where $adjusted_date
for timestamps would be time() - (5*60)
. And for DATE types something like date('Y-m-t H:i:s', time() - (5*60))
.