I would add that you can also do it like this:
--sample data
SELECT * INTO #test
FROM (VALUES (1,'blah AAA'),(2,'bbb bbb bbb'),(3,'AAA ccc')) t(id,val);
SELECT * FROM #test;
WITH your_table AS
(
SELECT * FROM #test WHERE val like '%AAA%'
)
UPDATE your_table
SET val=REPLACE(val,'AAA','[xxx]')
SELECT *
FROM #test
I like this technique because, in SQL Server Management Studio, you can highlight & execute just the SELECT * FROM #test WHERE val like '%AAA%' portion of the statement to see what rows are going to be updated.
-- Itzik Ben-Gan 2001