An unlock code for your K510i is difficult to get for free unfortunately but there are ways of doing it for a very small cost
The safest way would be to contact Orange and ask them to give you a code. I will be surprised if they do this for free but at least you get your phone safely unlocked and it will still remain in warranty. If it is out of warranty, you could go to a local phone store/market stall etc. And ask someone to unlock it (it usually costs around £10)
Looking online there are many sites that claim to unlock phones though I know that some are untrustworthy, However, GiffGaff offer a service that tells you the best sites to go to as voted for by their members. Here is a link to the page relating to your phone K510i
I really hope that helps, if not the other way is to sell it on eBay and then buy a phone on the network that you want to join.