diff --git a/modules/PremiumPodcasts/Models/SubscriptionModel.php b/modules/PremiumPodcasts/Models/SubscriptionModel.php index 84a37138963ae3f1fe09d8342be2d3e682a38504..f9d9aea316c4a3754ec679ae0e3e0d4e65d6ba8c 100644 --- a/modules/PremiumPodcasts/Models/SubscriptionModel.php +++ b/modules/PremiumPodcasts/Models/SubscriptionModel.php @@ -116,11 +116,13 @@ class SubscriptionModel extends Model return $subscriptionModel ->where([ - 'token' => hash('sha256', $token), - 'status' => 'active', - 'expires_at' => null, + 'token' => hash('sha256', $token), + 'status' => 'active', ]) + ->groupStart() + ->where('expires_at', null) ->orWhere('`expires_at` > UTC_TIMESTAMP()', null, false) + ->groupEnd() ->first(); }