Use COALESCE:
UPDATE testjson SET extra = JSON_SET(COALESCE(extra, '{}'), '$.age', 87);
SET extra = JSON_SET(IFNULL(extra, "{}"), "$.age", 87)