Just select both of them, if each of them has some-class , the condition is true:
if (!jQuery('#selector1, #selector2').hasClass('some-class')) {
Or, if I misinterpreted your logic, you can (and should, for the sake of speed and simplicity) break them into two parts:
if (!(jQuery('#selector1').hasClass('some-class') || jQuery('#selector2').hasClass('some-class'))) { //code here }
source share