So as koz has indicated, you should not be routing your keyboard back out to your headphones. Generally, you cannot solve this issue by throwing money at it; I’m thinking your existing computer might work just fine.
So there are going to be two kinds of latency. The first is the delay from your pre-recorded track to the new track you are laying down in real-time. There is a latency compensation adjustment for this Edit > Preferences > Devices > Latency. But this is only going to be approximate. You will generally have to make fine adjustments to the track after it is recorded.
The second delay is the round-trip time from when you are playing a note then running through the mixer to the computer then back to the mixer and finally to your headphones. There will be a built-in delay here by the computer (to allow it to multi-task) of typically 100 msec (1/10th second), which is annoying to most people. So the trick here is to not do this at all. Instead, monitor the keyboard directly from the mixer.
In Transport > Transport Options turn OFF Software Playthrough and turn ON Overdub. This will tell Audacity to output only your original “background music” track and only record the incoming audio from the mixer.
So on the mixer side, things can get a little confusing and sometimes they can’t be done at all. So you have audio passing in two directions through the mixer - the trick is just keeping them straight. I’m thinking that you can input your keyboard through either channel 1 (mono) or 5/6 (stereo) and the level adjustment for each channel will send the audio to the USB Stereo Output. This audio is also sent to your Monitor/Phones output (unless you press the Stereo/Mute button, so be sure to leave this up).
That leaves monitoring the USB output from the computer. If I am reading the manual correctly, that is going to appear on channel 9 when you press the Line/USB button. Now to prevent this channel 9 output from going back to your USB port and causing a echo, you need to depress the Stereo/Monitor button at the bottom of the channel 9 control section.
So in summary, turn OFF Software Playthrough, turn ON Overdub, Depress the Line/USB button, depress the STereo/MON button, and release the STereo/MUTE button. So as I said, this is all a little tricky, but I suspect you do not need to throw additional money at this issue.
And NO, you are not going to have any speakers or headphones connected to the Mixer’s Stereo Output. The Stereo bus is used only for what is being sent to the computer. Your “Main” output will all be coming out of your Monitor/Phone connectors.
Note: According to the MG10XU manual, you may need to download and install the driver from http://www.yamahaproaudio.com/mg_xu/