UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cfNAB5ytVEUZcNWw+o9Se6Ql9Ab0buq7jtr3WA7O4C4=' 
WHERE 
  key_id = '996de5bb190d7a8a720e3fec1e45fc31caae30a0962413309235bc5c3614d383' 
  AND (
    token = 'cfNAB5ytVEUZcNWw+o9Se6Ql9Ab0buq7jtr3WA7O4C4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022