UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PRJRXd8A61NGJ3Np0KnC9pI0fUIjs4FbG9iAuMlgwL4=' 
WHERE 
  key_id = '918fdbe896cd81ea8a3034e32c98378d5d670fa55a4a75b64ef3fdd5c701a62c' 
  AND (
    token = 'PRJRXd8A61NGJ3Np0KnC9pI0fUIjs4FbG9iAuMlgwL4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041