We demonstrate a technique to lock simultaneously two laser frequencies to each step of a two-photon transition in the presence of a magnetic field sufficiently large to gain access to the hyperfine Paschen-Back regime. A ladder configuration with the 5, 5, and 5 terms in a thermal vapor of 87 atoms is used. The two lasers remain locked for more than 24 h. For the sum of the laser frequencies, which represents the stability of the two-photon lock, we measure a frequency instability of less than the Rb natural linewidth of 6 MHz for nearly all measured timescales.