UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f7lbHK3xRpUPCY3wVz1pSsFR+5ylAI45M4QE5O1vNg8=' 
WHERE 
  key_id = '23c26f2e80868a241b6865467f4496e9f6f34845a4faa40fdfc86ed46aad7997' 
  AND (
    token = 'f7lbHK3xRpUPCY3wVz1pSsFR+5ylAI45M4QE5O1vNg8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00081