That's as backwards as you can get. Instead of installing a 30 amp breaker, you keep the 20 amp breaker and install #10 wire to replace the #12.
My small compressor would trip the 20amp breaker in cold weather occasionally. I replaced the #12 wire with #10 wire, keeping the 20amp breaker. Then I changed the compressor oil to synthetic. It hasn't tripped the breaker again for over 10 years.
It's probably that the synthetic oil did it. Although if I rewired it for 10 gauge I would just buy a 30 amp breaker because they are cheap. One issue too is you can't just buy 3 feet of wire, you have to buy 15 ft and locally that is around $20.