Luckily MySQL has a built-in string that helps with replacement functions. You could use something like the following:
UPDATE table SET field = REPLACE(field,'/files/','/sites/default/files/');
You can actually use other functions for more complex replacements (for example regex).
UPDATE table SET field = REPLACE(field,'/files/','/sites/default/files/');
You can actually use other functions for more complex replacements (for example regex).