UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6+C774EiKivXSzJZWkvc4Kds1GZMb9xN/lcgE2twBGA='
WHERE
key_id = 'db85ee0ccab7e4a05314b4fa9eeb088d1f6eb30578eb741c43acfcc998458d70'
AND (
token = '6+C774EiKivXSzJZWkvc4Kds1GZMb9xN/lcgE2twBGA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)