UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RdCDSEqX/KnMbIivpFuAKxo/b21Q6Xvcx0jNFqjQdoA='
WHERE
key_id = '9ded6a753f172d3bcacce88a5f073dd6a29032ee011ede710ddc19359901b090'
AND (
token = 'RdCDSEqX/KnMbIivpFuAKxo/b21Q6Xvcx0jNFqjQdoA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)