Write a thread-safe utility class that manages concurrent write operations to a local SQLite database or encrypted key-value store.