UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5lKeddtvaQ38DwOn/eBCQ1jxq7cq5LDo0ZLjHuoy+XE=' 
WHERE 
  key_id = '748f65a3d36936d22a35198edaecb1395118cbe0ff11c2e23c2ceb83decb8da5' 
  AND (
    token = '5lKeddtvaQ38DwOn/eBCQ1jxq7cq5LDo0ZLjHuoy+XE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025