IPhone warranty and Unlocking?

I just bought a new iPhone 5S from T-Mobile on 2 years contract, but I'm going to my homeland next month and I have an extra sim card for that, cause it would be extremely expensive to talk with people in roming. But unfortunately there's simlock on the phone, and I heard something like if I unlock or jailbreak it (don't know what's the difference) then I'll void the warranty, but how do they know that I did that if I did that. I asked some people and a friend of my friend worked at an Apple store and he said that if I normally restore, they'll know it, but if I DFU restore it then they won't know, but I want to make sure before I unlock it. So does anyone know if the warranty is void when I jailbreak it and then DFU restore it?

Jailbreaking voids the warranty, unlocking doesn't. Unlock is for the sim card and carrier connections. Jailbreaking is reformatting the iOS to do and download things that aren't Apple approved. There's risk in jailbreaking so tread carefully. Best luck.
http://www.redmondpie.com/jailbreak-ios-7.1-update-apple-patches-evasi0n7-jailbreak/

I just want to unlock, but am I going to have any problems or warranty void or punishment for unlocking?