First, check the boot lid isn't twisted.
If that looks ok, look at the corners of the boot lid, you'll see a small rubber stop at each corner.
They look solid but in fact are helically cut. That means you can wind then in and out.
So, take the lock mechanism out of the equation by moving it to its lowest position, lubricate the rubbers stops ( washing up liquid is a good rubber lube ) and wind them in/out until the boot lid sits where you want it to be.
Finally, adjust the lock.