Use REPLACE in update query using db_update
The replace function doesn't work when the field is a placeholder. This will insert the field string as new value in the database. I've solved this problem removing the placeholder. Check it out:

foreach ($tables as $table =&gt; $field) {
  $num_updated_1 = db_update($table)
    -&gt;expression($field, 'replace(' . $field . ', :old, :new)', array(
      ':old' =&gt; 'old_value',
      ':new' =&gt;  'new_value',
    ))
    -&gt;execute();
}


This way the code will work perfectly. I hope this may help someone.