UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xz2cstw+GamcSJk+3nnkxDBhOKQRYyIDReFjGz3OiD4='
WHERE
key_id = '4ae8b9854a9487bb7e5671f73e2f1d9c99a076f8a98334ac41459ff62ddb7c5f'
AND (
token = 'Xz2cstw+GamcSJk+3nnkxDBhOKQRYyIDReFjGz3OiD4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)