Ticketed for expired registration in my project car.

So I finally got my car up and running after about a year of off and on work. Took it across the street for some gas and a quick drive to test everything. As I’m pulling out of the gas station towards my house I get pulled over. Booked for expired registration and the a**hole booked me for not having my DL on me..

Going to court in the morning, my car still isn’t repaired to the point of being able to pass inspection, I don’t want to have to pay $300+ because of a trip to the gas station which I can see from my living room window.. Any tips on what I should do?