UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yOXnTBqTf7dJ2WSebiMVzdsH7ky1WYsKPjJeXw9FGoo=' 
WHERE 
  key_id = '48340b578e60b08442ffea74a699ec5f64dbc7d213b93bd865f161d4115073bd' 
  AND (
    token = 'yOXnTBqTf7dJ2WSebiMVzdsH7ky1WYsKPjJeXw9FGoo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024