UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't1Axe8pTtZdQ1xjoIkMUr/j81rGHNq1FzNQNB7X2Nks=' 
WHERE 
  key_id = 'd54e927c241e6bcb13ec6ee96ce2500c74cffa78dc2cb2ae3c5c4c28d29bf703' 
  AND (
    token = 't1Axe8pTtZdQ1xjoIkMUr/j81rGHNq1FzNQNB7X2Nks=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019