Either way, the cost is 4600. For mexes, you do NOT get a discount for upgrading in place.
What you get from upgrading in place is: (1) the mex continues to give 6-9 mass/second (depending on how many storages you have, and of course a power stall would make it smaller) (2) the mex contributes some build power to the upgrade; and (3) you don't need a T3 engineer. Benefit (4) is that this method takes less APM than the alternative.
What you get from ctrl-k the mex and build on top of it: (1) about 700 mass in reclaim, I cba to actually test it to tell you the exact number. It takes a negligible amount of time to reclaim the mass
If you have a T3 engineer and enough BP to build the mex quickly enough (and of course, mass stall or power stall would also increase the build time), the 700ish mass you get from reclaiming the dead mex is better than the 9 mass/second you would get from upgrading the storaged T2 mex in place. That's why you see air players in Setons upgrading mexes this way, they have a plan to do it and they have APM to spare. But in 1v1 matches usually people are adjusting their ecos on the fly (they can't just follow a 15-minute air slot build order) so they don't have APM or engineers or spare mass/power to make it worthwhile to upgrade mexes this way. They might do a few like this when it's convenient, like if the ACU goes to T3 to make a pgen but otherwise you barely see this.
There are other situations in the game where you DO get a discount for upgrading in place. For example, T2 and T3 support factories.
Would it make sense to change things so that mexes also get a benefit from upgrading in place? Maybe. But there is a lore-friendly reason why factories would get this benefit and mexes wouldn't. Factories are designed to make things. Not just 1 thing but many things. so it makes sense that they would get a discount to upgrade themselves. Whereas mexes, radars, etc would not get the same discount. they're capable of upgrading themselves but they're not optimized for it.
Also, you can always find out for yourself the answer to these questions. Just start a sandbox game with cheats on. Ctrl-k your acu so you cut off the mass and energy income. Make some mass storages and e storages, make some stuff and ctrl-k it so you can scoop it to fill up your mass storage. Now you have a bank of mass that doesn't grow or shrink. Give yourself a bunch of T3 engineers or hives for lots of BP. Like if you have 50 t3 pgens and 100 hives and 5k mass in the bank, you can upgrade a t2 mex to t3 very quickly. So quickly that the 6 mass/second you get from upgrading it in place will be super small. So you can see if yourself if you lost 4600 mass from storage or if you lost less than that.