UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HNR/X3qdh7GQ9bDFpQk2svS7snu+V4Y270B8Bspy+7U=' 
WHERE 
  key_id = 'e6b032b274d902b09a22996f1076c0ce86a9e2e35de153579fe00222b2bd7713' 
  AND (
    token = 'HNR/X3qdh7GQ9bDFpQk2svS7snu+V4Y270B8Bspy+7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025