By using WordPress Function Alter Mysql Data

I’ve create one custom table, with ID and Description. I would like to use wordpress function to change the Description’s values by refer to the ID if user purchase woocommerce item..

I try to read the API, but I don’t know if I doing this right.

I’m new in wordpress, php & mysql 🙏 sorry if I write it wrong,repeated,complicated etc.