UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '85fZCKt4jaoSd/kDRHgkIb+LaV9uAigs3Mjr1DrDZ8w='
WHERE
key_id = '01d3052701db150ef0ba7489f169b6d869bc78b1aab1fdac87d1a110103d291a'
AND (
token = '85fZCKt4jaoSd/kDRHgkIb+LaV9uAigs3Mjr1DrDZ8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)