UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CRPZcf5VbzfKaQn/canHSajoTl2OewJE/r+AOsWrlzc='
WHERE
key_id = '83e1a5986e7f7fd81dc3997e95a0bfb7e9dcda4f325839b5fa8565ed18538a26'
AND (
token = 'CRPZcf5VbzfKaQn/canHSajoTl2OewJE/r+AOsWrlzc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)