$wpdb->get_var not returning a result

$wpdb->get_var returns a single variable, but your SQL statement has SELECT * which returns a row of multiple columns.

You need to change your SQL statement to SELECT ID ... instead of SELECT * ...