Idea is to abandon key usage. Neither generated with ftok() nor generated in any other way. Keys should not be used to create Zabbix mutexes and shared memory segments because explicit key usage may lead to conflicts when other applications depend on the same key. Alternative is to use IPC_PRIVATE constant and forget about ftok().
As a side effect this change requires that we remove SQLite support for main Zabbix database because we will not be able to share mutex for DB access between frontend and server any more.