Can i update my unlocked iphone 3gs?

A few months ago I unlocked an old iphone from AT and T and jailbroke it in order for my tmobile sim card to work. My phone has been really really sluggish and apps restart my phone but the update for 5.1.1 is available but i heard it would reset the process of unlocking and it will BRICK my phone.

It will not be locked if it is factory unlocked by att.