The difference is tone and formality: in spoken American English, some people will definitely say to a friend, "Have you got the key to the storage shed?" But in my experience, at any higher level of formality, key for is more "correct" sounding and common.
But I think it's common to flip the expression around and avoid the preposition:
...the shed key...
I lost my car keys again.
That last one is super preferred in that situation. You probably wouldn't say "keys to my car," unless you're clarifying between the car and something thing else. And when it involves a "key pad" and not a physical key, we've got both on our apartment door. So we have conversations that go like:
I forgot our apartment key code.
Your example is interesting:
Do you have the key to the shed?
That's a fine sentence, written or spoken. But it has a certain connotation to me, as a US English speaker: it's not "neutral". It sounds like the speaker has lost the key and is looking for it ... and probably suspects me of using it and not putting it back where it belongs. :-)