2021 Q3 Lease Sell or Keep?

Hey guys, new here and want to ask for your advice.

Currently leasing a 2021 Audi Q3 and have 6 months left till the lease end. My monthly payment is around $400, and the residual value is ~$24k. I checked with the dealer last week and they told me if I wanted to purchase the car now, I just need to pay the $24k+$2400 (remaining lease), and it will take them around 2-3 months to process and give me the title. I got the quote from Carmax and they are offering ~$30K to buy this car. (Was $33k a month ago thou) Any advice what I should do? Essentially I will need a new car but I’m ok to stay with the Q3 for another year or two. Thanks!