Look at it as a cost per month for the guaranteed support period. The Pixel 6 has 22 months of guaranteed support, while the 7 has 34 months.
So if for example the Pixel 6 is $100 and the Pixel 7 is $150, that means the Pixel 6 has a monthly cost of $4.55 ($100/22 months), while the Pixel 7 has a monthly cost of $4.41 ($150/34 months). That means the Pixel 7 is the more valuable buy, assuming you have the extra $50 available.
Of course, the Pixel 8/9 series is significantly more secure, has more features, and has a longer support period. So it may be worth considering those too, again assuming you have the extra cash available.