UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3eiIUnFwZ7F7gU9vcV3xy7c+46sZ8BrQyS9ERUl9AG0='
WHERE
key_id = 'b9d2afbfc67b8f6b76b6a391343b366171ea38d4ef82d53e026e2c86751d7f7b'
AND (
token = '3eiIUnFwZ7F7gU9vcV3xy7c+46sZ8BrQyS9ERUl9AG0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)