What's faster: two UPDATEs with WHERE (in / not in) or one UPDATE with CASE?
You should perform an UPDATE LEFT JOIN and set enabled based on the right side being NULL

UPDATE table1 A
LEFT JOIN table2 B
ON A.code = B.id
SET A.enabled = 1 - ISNULL(B.id);


Why should this work ?


If ISNULL(B.id) is 0, that means A.enabled is set to 1 (1 - 0) because it is in table2
If ISNULL(B.id) is 1, that means A.enabled is set to 0 (1 - 1) because it is not in table2


@ypercube suggested 

UPDATE table1 A
LEFT JOIN table2 B
ON A.code = B.id
SET A.enabled = (B.id IS NOT NULL);


GIVE IT A TRY !!!