ActiveRecord will handle converting a Time into something your database understands, so you don’t need to worry about that. You can also write the where clause manually like you did, or you can use arel, which would be my preference. You can also chain .where()'s, since they just return ActiveRecord::Relations and don’t actually execute until they need to. Here’s how you could rewrite your code:
I would also probably create scopes for all of those other conditions, or maybe wrap them into a single scope if you can produce a term that accurately describes products that are in that exact state.