UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oSM5ocFTNLp5fXD/z1LWTi2xKOVe1wFXhcn1Q6MYIAs=' 
WHERE 
  key_id = '7e2a827682f7c3de14a10ee07a6a9d209bc3ba091a66ab01f2de5ee43b9db7c6' 
  AND (
    token = 'oSM5ocFTNLp5fXD/z1LWTi2xKOVe1wFXhcn1Q6MYIAs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016