UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bmOB43eoNFUThMfGL7OcasNMWvGH6lU1Ss3m26P/TMQ=' 
WHERE 
  key_id = 'faa0a60129dc9a6da5b220c2c9522bd63152fdd8d5dba86b64e1a0deaea92129' 
  AND (
    token = 'bmOB43eoNFUThMfGL7OcasNMWvGH6lU1Ss3m26P/TMQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029