Attack at ketone vs carboxylic acid carbonyls
The keto group is more reactive compared to the ester group due to the mesomeric effect (+M effect) caused by the hydroxyl group in the ester functionality, as already pointed out by orthocresol. See also  https://en.wikipedia.org/wiki/Carbonyl_reduction. Generally:
$$
 \mathrm{acylchloride} &gt; \mathrm{anhydride} &gt; \mathrm{aldehyde} &gt; \mathrm{ketone} &gt; \mathrm{ester} \approx \mathrm{carboxyl} &gt; \mathrm{amide}
$$

A very detailed discussion on the subject is given for example in Warren Organic Synthesis: Strategy and Control or in Francis A. Carey Advanced Organic Chemistry - Part A.