Create or update a key

Creates or updates a key with the given value.