Update key matching function.