I'd recommend using Dungeon World with the 'Dungeon Planet' supplement. DW is a rules-lite sort of D&D fantasy styled game which has no real setting (you make up your own for it) and Dungeon Planet transcribes old pulpy scifi into that game, giving a John Carter/Flash Gordon feel to it. Again, the things in it are kind of like a toolbox, you can pick and choose what you like for both to make your setting as you like.
I'd also recommend Mongoose Traveller for some inspiration... It doesn't have magic, but it does function in a similar way to D&D, has space rules, ship creation and tech levels for planets and gear, which you can fiddle around with, including ray guns and cyberware at higher TLs. Oh and planet generation rules too!
I made Wander Worlds (check the thread in my sig) as a Dungeon World setting which has space stuff involved in it. I didn't include cyberware or high-tech guns, but I could have. I used Traveller to help generate the planets and decide the cut-off point for technology. Because I built it to function with Dungeon World, I got to have magic in there along with space travel.
Hope that helps. :)