How do you plan on unlocking the iPhone? To the best of my knowledge, AT&T will not unlock it for you, you have to search out ways to do it yourself which could turn your iPhone into a brick.
You will be able to use the iPhone with your AT&T sim card in South Africa, you'll just pay really expensive international roaming rates.