You need to use the type-sensitive comparison operator ===.
The hashes evaluate to 0e462097431906509019562988736854 and 0e830400451993494058024219903391, respectively. When you use ==, each is converted to a numeric representation because of the e (scientific notation), so they each become 0. 0 == 0 is true.
On the other hand, this:
md5('240610708') === md5('QNKCDZO')
returns false because the string values are different. === forces type-sensitive comparison.