I agree with several above about replacement. 40 years is not too old for most.
I just replaced our house's main panel and exterior mast feed system but NOT solely for age. It was 51 years old with FUSES (not breakers) that I had installed as a poor graduate student at as low a cost as I could. Last summer we replaced our central gas furnace and added AC, but even the AC compressor unit needed only about 10 A max at 220 V, not a big added load. But our other main project was adding a new garage out at the back with a cable buried to it for electric power. As I have that wired the projected max load on a standard 120 / 240 V split feed would be about 20 A, again not too huge, but an increase for sure. However, in anticipation that someone in the near future might want to add to that garage a charger for Electric Vehicles, that item can easily be a 30 to 40 A load in today's designs, and might be over 60 A in future designs. So the buried cable and sub-panel are rated for 100 A. To accomodate all of that I DID have a contractor update our old 100 A service panel to 200 A. As I said, though, that was for projected major load increase, and not for age of the equipment.
Different size of service, and I don't live in the USA, so my costs probably do not help.