Use unique with the 'rows' option to extract the keys and their position and accumarray to get the mean according to the keys:
A = [100123 1 1 2500; 100123 1 2 2502; 100123 2 1 3000; 100123 2 2 3005; 100123 2 3 3003; 100456 1 1 5000; 100456 1 2 5005; 100456 1 3 5003; 100456 2 1 4300; 100456 2 2 4305];
[keys, ~, indices] = unique(A(:, [1 2]), 'rows');
keysmean = accumarray(indices, A(:, 4), [], @mean);
[keys keysmean]