Well, microcontrollers don't go obsolete in the performance sense; if they are good for task X now, they are good for task X in 20 years, too. Of course with new micros, scope widens, but computationally "simple" projects are not disappearing. (And that "simple" can be quite astonishing for today's $2-3 32-bitter; they are overkill for 95% of projects today, and will be overkill for many projects still in 2035.)
But keep in mind that a devboard/demoboard with a discontinued MCU isn't that useful; you can use it to do one-off hobby projects but can't then order the MCU from Digikey and make a PCB for it.
Your best bet is to look which MCU is very popular (like in top-10) and has been there for a few years. Like, ATMega328 was very popular in 2010, and consequently, you can get ATMega328(P(B)) today even though it's much less popular now, and many other Atmel MCUs from the same era has been discontinued (or are to be discontinued in near future), and even though 8-bitters in general are in decline. So those old Arduino boards are still just as useful they were when shiny and new, thanks to them being popular.
Same with 32-bit ARM. Just because a chip is ARM and 32-bit doesn't mean it's going to be here forever. But if you pick some of the most popular chips chances are better than with some esoteric part randomly picked from Digikey's parametric search only because it seems to fit your requirements best now. Manufacturers like ST have some commitment how long they produce the part, but those (quite a) few parts that sell really well obviously get extended.
Then again - remember, a devboard is not an absolute necessity! I have been using devboards for FPGAs because of their relative PCB complexity, but last time I used MCU devboard was in early 2000's (Atmel STK200 bought in 1999). After that, for quick testing, I have just taken an MCU, glued it dead-bug on a piece of copper clad or even plastic, and soldered some wires. For 0.5mm pitch QFP packages, an adapter PCB might make your life easier (still optional, you can dead-bug+air-wire these, too). If you then so wish, the prototype becomes a permanent one-off by applying some glue to hold things together, or you can desolder the few IOs that are different in the next project.