UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tQZtCErh0eCltdg816EblrrHms5w+HwKvbib4oRAMoc=' 
WHERE 
  key_id = 'f0bb3384de7a239c4769f963e4681a62a6e69bd5ab4af53ca2c64902bd11ffca' 
  AND (
    token = 'tQZtCErh0eCltdg816EblrrHms5w+HwKvbib4oRAMoc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035