UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uzRr/Lc6sFqHdFoBjpdApvOlNHoWHAhy49xmGktoWHc=' 
WHERE 
  key_id = '07a3a9f67abea68ed8fcf7fd09ed67faeccae285eea984ba43a42a68121c55c0' 
  AND (
    token = 'uzRr/Lc6sFqHdFoBjpdApvOlNHoWHAhy49xmGktoWHc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031