UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4eAwAs/pNtkzoGiyf4n28YZt0f9Dl19lBr1rCWf2XLs=' 
WHERE 
  key_id = '2f0d9666b7af816818959bb5a28d2aa75ae4f6460bdd0d83bbe3788180a6f1ec' 
  AND (
    token = '4eAwAs/pNtkzoGiyf4n28YZt0f9Dl19lBr1rCWf2XLs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038