UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FOVLgJFrThc7L4eZ1z0IXvfoOSv7skRG/X4xUuZcKCI=' 
WHERE 
  key_id = 'd66a195d5e0a020e251c50488d05a846b3a427e36406d5aa737447789702e072' 
  AND (
    token = 'FOVLgJFrThc7L4eZ1z0IXvfoOSv7skRG/X4xUuZcKCI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021