Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

expiry not null aand past

$meta_query = array(
	'relation' => 'AND',
	array(
		'key'     => 'expiry_date',
		'value'   => '$current_date',
		'compare' => '<',
	),
	array(
		'key'     => 'expiry_date',
		'value'   => 'null',
		'compare' => '!=',
	),
);