UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HfrMR/jnev8MP6NRuyP3NkgldB++itmAVt7o/d2cUQ8=' 
WHERE 
  key_id = '46a0bead46d2421fcddde6772d5bf77e20e8a4f650a57be2790f6454d96c8723' 
  AND (
    token = 'HfrMR/jnev8MP6NRuyP3NkgldB++itmAVt7o/d2cUQ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016