If you’re in the US the one retailer that I know has a same day exchange is Best Buy. You’d wipe the old one, take it in, get whatever store credit you get for it, use that towards a new one. They have an estimator on their site to see how much you’ll get for it. Bear in mind these places give you a lesser amount because they want to turn around and sell it used and still make money, so you likely won’t get a lot.
Your other option is to buy the new one and sell the old one.
What to do before you sell, give away, or trade in your iPhone, iPad, or iPod touch - Apple Support
Make sure to back up the old one. You can use that backup to make the new one a near clone of the old one
Transfer data from your previous iOS device to your new iPhone, iPad, or iPod touch - Apple Support