UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Kb/rQaUXJbXtsfme4sv5Fdybv23tye5Kz3iB0N60x70='
WHERE
key_id = '83721ec2e23777f834cac846dee335e993ff7806f299516b54c8cea9a03511ec'
AND (
token = 'Kb/rQaUXJbXtsfme4sv5Fdybv23tye5Kz3iB0N60x70='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)