I can’t give you advice on these specific cars or price, but educate yourself on the CPO coverage (miles/term/what it covers), before you go to dealer get quotes for third party warranties, look for something that will cover the tech.
If you get into the finance office on that X5M that isn’t a CPO, and they offer you a wraparound warranty for $8000, will you know if it’s a good deal or not? All they’re going to tell you is that the infotainment screen cost $5000 to replace.