Use "collate utf8mb4_bin" not utf8mb4_unicode_ci (which makes WHERE clauses case-insensitive).
Removed debug logging.