Failing that and with a receive, you might try creating a match spec dynamically. Combined with :erlang.trace_pattern/[2,3] you might be able to accomplish your goal.
Edit:
I’ve found that this works:
k = :a
v = 1
match?(%{^k => ^v}, %{a: 1, b: 2})
true
v = 9
match?(%{^k => ^v}, %{a: 1, b: 2})
false