You'll want to use BINARY(64)
, as the hash is exactly 64 Bytes long, so you don't want to use variable length types. You don't want to use any character data type either, as the hash is binary in nature. Without characters, you don't have any collation.
The fixed length and the absence of character encoding and collation allow for certain optimizations. If it is still too slow, try some generic MySQL optimizations or if that doesn't help either, a smaller primary key size.