It depends how long you want it to be. I’d buy a cable if the correct length instead of messing around with extensions.
I'll echo the others. Just buy a cable of the right length. 5m USB 3.0 cables aren't exactly expensive.
A slightly long cable gives you flexibility.