Moving MSDB database files fails
First, you should use:

... WHERE DB_NAME(database_id) IN ('msdb', 'xxx', ...)


or 

... WHERE database_id = DB_ID('msdb')


Syntax for ALTER DATABASE is: 

ALTER DATABASE database_name MODIFY FILE ( NAME = logical_name , FILENAME = 'new_path\os_file_name' )


In your case values are as follow:


database_name = MSDB
logical_name = MSDBData (or MSDBLog)
'new_path\os_file_name' = 'C:\Data\MSDBData.mdf'


Then you can follow this procedure for MSDB:


execute ALTER DATABASE MSDB MODIFY FILE ( NAME = MSDBData, FILENAME = '...new path' )
and/or execute ALTER DATABASE MSDB MODIFY FILE ( NAME = MSDBLog, FILENAME = '...new path' )
stop SQL Server service
Move MSDBData and/or MSDBLog to their new location
Start SQL Server service
Check new file location

SELECT name, physical_name AS current_file_location
FROM sys.master_files
WHERE database_id = DB_ID('msdb')



You must replace value such as MSDB, file location, file name with the correct values for your environment.