update only a part of url path in database
Try the scanner module instead: 

http://drupal.org/project/scanner


  Search and Replace Scanner can do plain text search-and-replace, or regular expression search-and-replace, against the title, body and text content fields on all nodes in your system. This is useful for finding html strings that Drupal's normal search will ignore. The module is very handy if you are fixing typos in a lot of content, changing the name of your company, or are changing the URL of a link included multiple times in multiple nodes, among other things.


Your sql query might work but this is a little more robust and has a rollback option.