Robert Lewandowski is 34 years now. IMO, he has at least 3-4 years of quality football left in him. So it is too early to talk about his retirement. Ronaldo is performing exceptionally at the age of 37. The same can be said about some of the other players such as Goran Pandeev and Luka Modrić. Nowadays, players are able to maintain optimal form well in to late 30s. Lewandowski has scored 13 goals from 14 La Liga matches for Barcelona so far in 2022. That shows the sort of form he is in. And during the previous year, he scored 35 goals from 34 appearances in Bundesliga. 2020 was even better, with 41 goals from 29 matches.
Yes, medicine, including restorative medicine, is developing very quickly and this is reflected in the longevity of athletes (we can observe this in all sports). Lewandowski definitely has 3-4 years ahead of him where he will play close to his best level.
By the way, imagine how many goals Mbappe and Haaland will score if they play until the age of 40 at the top level

There is no doubt about these two ability and quality, and we can expect tough competition and comparison between these two even right now Mbappé is far ahead from Haaland but as you saying if these two could be able to play until 40 then surely we can expect too many records and awards in front of their names but right now prediction is not possible because injuries and other factors also can create their own impact which is also having impression on their performance in future as well even right now things looking amazing, and we can expect good positive competition for long run in club level and now with the next world cup is going to play with 48 teams most chances we will be able to have Haaland also in the world cup which could be more excited.