Find something that interests you in very advanced computer science or mathematics and learn it extremely well, while building out a breadth of shallower expertise in foundational and peripheral CS/math.
You do this for two reasons: 1) if you learn (and can apply) what is very difficult for others to learn, you'll have very good job security and better overall work opportunities; 2) everything else that becomes vogue will be comparatively straightforward for you to learn, because it's merely an application of what you already know. This gives you a head start on what's vogue in the future.
Let's look at an example: say you understand linear algebra and statistics extremely well, and can productively write performant code that leverages this understanding. You are now good at machine learning (or have the capacity to become good)! You're also good at understanding cryptography, which means you can ride the cryptocurrency job boom if you want.
I can guarantee you that there will be, or is now, an emerging renaissance in some field which will be happy to pay people with very rare, useful and generalizable skills compensation that would make you double take. Don't kneecap yourself by learning "just" AI.