You buy a BMW because you want a BMW. If you’re worried about resell value, you’re doing it wrong. There are many cars out there that will hold their value better than a BMW. If that is your primary concern, get rid of it and buy a Lexus ES or something that will hold its value better.
If your M340i has the 48V mild hybrid system, quite a bit since the car can coast with the engine off. 15-20% fuel savings if you keep your foot out of it.