The operator caseadds time because it is running.
Decision? Store pairs in a temporary table., With index. So:
create temporary table code_pairs (
old_code varchar(255) not null primary key,
new_code varchar(255)
);
insert into code_pairs(old_code, new_code)
values ('akdsfj', 'kadjsf'),
('asdf', 'ndgs'),
. . . ;
Then use updatewith join:
update test_table tt join
code_paris cp
on tt.code = cp.old_code
set tt.code = cp.new_code;
, , case. , , . 170 000 , , , case.