UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bq+kbq7h8yieYSSz0JUgZ8lyhX1SxY+AffDjqkdWYWQ=' 
WHERE 
  key_id = 'ee856a4a8fe798ff2c3a61d4ba11b7ad7b7686eefc0a5b1f4f0af92d49203031' 
  AND (
    token = 'Bq+kbq7h8yieYSSz0JUgZ8lyhX1SxY+AffDjqkdWYWQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034