UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IQA96huIMgMvPQef7Xzgj+9562qSPBV9/KkJradT3no='
WHERE
key_id = 'ccbe5e2cfe573c3ce23e87d2101d5a9fecd537f53982e19eb084ba701acb2992'
AND (
token = 'IQA96huIMgMvPQef7Xzgj+9562qSPBV9/KkJradT3no='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)