Another way to say "a key is used for opening a lock" is "A lock may be opened by using a key."