I think the locking is not required here, as we only write the key if we're main owners and that means we already have the lock acquired.