From a resolution(only)/best value perspective - upgrade the camera first.
Hi M.,
That's often the case. Sensor sampling density is relatively easier to upgrade than lens resolution, unless the latter is very poor (e.g. and if it matters, in the extreme corners).
We've seen sampling density and thus the limiting resolution (Nyquist frequency) go up from a 6.4 - 7.2 micron pitch to 4 - 4.88 micron, so say 35% in some 7 years. Lens resolution is more complex to catch in a single number, but I think the pace is
much slower and less dramatic. The biggest difference was due to analog sensor (film) oriented optical designs being replaced by digital sensor oriented optical designs (taking into account the optical filter stack and cover-glass, which also made rear anti-reflection coating and lens shape more important).
Maybe the OTUS jumps a bit further, instead of crawling, but that's mostly for wide open use because at smaller apertures things get diffraction limited pretty fast).
This is also kind of consistent with Jim's "quiver plots" which show that even with a given lens, the more significant improvement can be achieved by increasing the sampling density (i.e. reducing the pitch).
Of course there are other ways to improve resolution as well, e.g. shooting with a longer focal length and stitching for the angle of view, or using super-resolution techniques. But resolution alone is not as big a requirement for most, except for those who need to produce large output sizes.
So, changing the camera/sensor is often the faster approach to better image quality (resolution
and dynamic range and quantum efficiency), and will also allow to utilize improved useful features like live view, tethering, improved autofocus, faster shooting intervals, articulating LCDs, etc..
Modern lenses will last many generations of camera bodies to come, so there is less of a need to upgrade, unless for replacing a dud. Of course lens manufacturers will think of other features to incorporate in lenses, like autofocus improvements, which will only work together with the newest generation of bodies, but 'built-in obsolescence' or forced upgrading/replacement is a way of survival for those companies.
Cheers,
Bart