UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6PUUOBuxRXMs8aeqNEVTrLw50sWa+S3bpKnQXvYHzL0=' 
WHERE 
  key_id = '96aff537a5164d115cc30f62fc4c091830c297e7cfa1bfbbf2a1941e400fbdb6' 
  AND (
    token = '6PUUOBuxRXMs8aeqNEVTrLw50sWa+S3bpKnQXvYHzL0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036