UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7YDw5BjS1XfSaGNra7EUEq1QPX2ZtXMvhJnfhx9nLBw=' 
WHERE 
  key_id = '9e73fb517f0b0ba644b0a805d306ec834de2344be94bed53ebe5345002815869' 
  AND (
    token = '7YDw5BjS1XfSaGNra7EUEq1QPX2ZtXMvhJnfhx9nLBw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025