I think that you have 2 choicces:
The first is to replace everything, chain, cassette, and crankset all at one time. The advantage of that is you get it all done at once and you get to work with clean new parts which is always more pleasant.
The other is to replace the chain, cassette and middle chainring and see how everything else works.
__________________
My greatest fear is all of my kids standing around my coffin and talking about "how sensible" dad was.