Since the balance of your car loan is lower than the car's value, that shouldn't affect whether CarMax will buy your car. If they make you an offer and you accept, they'll pay off your lender, then give you whatever is left over from the sales price—the positive equity.
But CarMax will even buy cars with negative equity—you would just pay CarMax the difference between the sales price and your remaining loan amount.
If you want to sell a vehicle to CarMax that still has a car loan on it, schedule a meeting or walk into a branch near you. Make sure that you have the following documents to begin the payoff process: