Move where lock_timeout is determined.