UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HzOZ6ayhcq0hQICi60atQQ//Ixjfl5FQx3R2u3SIqjE='
WHERE
key_id = '96bef27223769dafea0e70a9c2879203950d1ac7aac352395e66079b3de42318'
AND (
token = 'HzOZ6ayhcq0hQICi60atQQ//Ixjfl5FQx3R2u3SIqjE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)