Try using:
Harvey(?![^<>]*>)
Which makes sure there's no closing angled bracket ahead indicating it's inside an HTML tag.
If that doesn't work nicely, maybe a positive lookahead instead:
Harvey(?=[^<>]*(?:<|\Z))
Which makes sure there's the opening angled bracket of a tag ahead, or the end of the string.
Which translates to:
"/".$internal_links_row['key_phrase']."(?![^<>]*>)/i"
"/".$internal_links_row['key_phrase']."(?=[^<>]*(?:<|\Z))/i"
respectively
EDIT: As per comment:
"~".$internal_links_row['key_phrase']."(?=[^<>]*(?:<(?!/a)|\Z))~i"
^ ^^^^^^ ^
I changed the delimiters and added a negative lookahead.