In theory, the old code could run indefinitely. In practice, interrupts and speculative execution make the details extremely unpredictable.
When an interrupt happens, the CPU stops what it is doing and runs OS code. Potentially a lot of OS code. That could force the CPU to evict cache lines.
With speculative execution, the CPU will try to predict the results of branch instructions. This includes trying to predict branch addresses generated through complicated calculations or loaded from function pointers. Modern CPUs are constantly doing instruction fetches from effectively random addresses, which can also evict cache lines.
So maybe the old code will run forever. Or maybe it will eventually be replaced by the new code. The CPU's microarchitecture will play a huge role in what exactly happens, but CPU manufacturers don't like publishing details of their microarchitectures. Tons of stuff related to the OS and how it handles interrupts matters a lot too. It would probably be easier to list the components that can't have an impact on this, and that is pretty much just code on disk that isn't resident in memory and can't be speculatively executed at random by the branch predictor.