You can use shortcodes on both sides of the condition (left and right of the comparison), so in principle yes, but I guess the question is where are you going to store these values of 20 and 50 that may later be changed?
If it doesn't make sense to store than as a custom field on some post or page (I don't know), you could register custom shortcodes to return each value and then you would just need to edit the code for those shortcodes each time you wanted to make changes.