I would avoid treating SYMPTOMS. If you have a nail in your shoe and it is impaling your foot, you can take the shoe off for a few weeks, take anti-inflammatory drugs and put a bandage on it. All these actions treat the symptom. The problem is when you put the shoe back on you still have a nail in your shoe. Take out the nail and the symptoms go away. Problems with ergonomic issues in your playing are exactly the same.
I'd have to watch you play to tell what you are doing wrong. What you do wrong can cause these SYMPTOMS. YOU are not broken. Your technique is.
Some of the many thumb problems you may have: Pressing into the keybed. Once you hit the "point of sound," pressing into the keybed only causes strain to the tendons. Remember HS physics, when you press into an immovable object, it is pressing with just as much force back into you. You will break, not it. Remember, the piano is stronger than you.
The muscle most pianists incorrectly use to play the thumb is the thumb's abductor. The abductor is a weak, slow and fatigable muscle. It is designed for gripping and holding, not playing down. A better muscle to use would be the pronator in combination with arm weight, up/down and a slight forward shift from the elbow/shoulder. Used simultaneously, this completely frees the thumb and provides a nice rotation for the rest of the hand (what the fingers are connected to) to get where it needs to go next and, facilitates the grouping of fingering.
Another error pianists make is crossing the thumb under the palm. The thenar and index tendons intersect. When you cross the thumb under, they grind together. That can't be good over time. To get around this, using the pronator, supinator and elbow will not only give you tremendous speed in scales and arpeggios but, will make the thumb feel effortless and powerful. The same is true with the pinky and ring fingers. They are not weak nor incoordinate, we just fail to adjust the forearm alignment from the shoulder and elbow.
Abducting all your fingers and stretching out your thumb's extensor (spreading out for an octave) creates a ton of muscular pulls and vector forces. This is the foundation for most injuries, uneven playing and mistakes. The arm can only move in one direction at a time. When we play from the fingers, we attempt to drag the arm and that creates tension in the fingers and tries to pull the arm where we don't want to go.
Of course I suggest seeing a doctor but most doctors treat symptoms and not the problem. A really good doctor will send you to a movement specialist who treats injured pianists and will fix your errors in movement and the symptoms will disappear.
This is the state of our pedagogy right now. A student experiences pain, fatigue, tension or cramps and a teacher will suggest they relax the hand or build up strength and endurance. All those answers are incorrect. It is the arm that plays the fingers. Your fingers have no muscles. A forearm muscle flexes, it pulls a tendon, your bones bend. When we play from the fingers, we strain the tendon caught between the bone and muscle. When a student experiences cramps from using the wrong muscles, the teacher suggests to relax but, they are relaxing the same muscles they are trying to play from. When we play properly from the arm, indeed, the fingers are relaxed. If a teacher says "relax," you should then ask, Okay, what do I use instead?
The solution is to take a lesson from HS physics and use the muscles and bones designed to move the fingers. If you must treat your symptoms, I suggest a contrast bath four times a day. Fill one large plastic trash pail with ice cold water, the other with hot as you can tolerate hot. Plunge both arms into each pail all the way up to the elbows for one minute. Then switch. Do this five or six times. The cold reduces inflammation and the hot increases circulation. End in hot. But, if you continue you play improperly, you achieve nothing. Our body does most of its maintenance and repair when we sleep. Make sure you get plenty of it.
Ultimately, just find a teacher who knows what a pronator and abductor is. They will fix you right up.