We can solve it using the SUBSTRING Like the following update query :
UPDATE data_table
SET data = SUBSTRING(data, 1, LEN(data) - 2) + '31';
We can also permorm this query using replace method with Substring
UPDATE data_table
SET data = REPLACE(data, SUBSTRING(data, (LEN(data)-2),(LEN(data)+2)),'31')