I want to update the value of a custom variable programmatically, I am using magento 1.9.2

I have tried the solution given at [programmatically create a custom variable](https://magento.stackexchange.com/questions/13730/programmatically-create-a-custom-variable) but this is for creating custom variable but I want to update the value of an existing variable, and also this solution is not working in magento 1.9.2

Any help regarding this issue?

thanks