UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9JwJZvUrsCA7TphG/uvq4dNjqDTZpS6nZgS+uok5nuw=' 
WHERE 
  key_id = '5ccfd87d1f0f1b9dea633a940e3895258d5662a26e889a7aa778ccdcb08e66d5' 
  AND (
    token = '9JwJZvUrsCA7TphG/uvq4dNjqDTZpS6nZgS+uok5nuw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038