UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N6qgpMSV0o2mOfaaJjQ2qc4onWHB8RE2s+eZ+A5QZVU=' 
WHERE 
  key_id = 'f4ce47ddba9eccc6e2f8bd0a928c50027f76859907f84bcd9ab29f6a35cbdcaf' 
  AND (
    token = 'N6qgpMSV0o2mOfaaJjQ2qc4onWHB8RE2s+eZ+A5QZVU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019