The new Mercedes GLC starts just under $40K and is quite a nice car if you don't add too many options. There are three listed on cars.com about $40K. Also, the GLK (pror version of the GLC) has almost a cult following due to its practicality and reliablity. I believe they did the change over this past year so there may even be a couple of new ones on the dealers lots. If not, MB has a very good "Certified" car warrantee.
I have a 2015 Audi SQ5 and have been very impressed. If you don't get the "S" version, I believe you can get a very nice one within your budget. Since the body style is changing (slightly) in a few months, you may be able to get a very good deal on a new Q5 (or on a 2015 or 2016).