diff --git a/modules/PremiumPodcasts/Models/SubscriptionModel.php b/modules/PremiumPodcasts/Models/SubscriptionModel.php index 84a37138..f9d9aea3 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(); }