UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'knsT1z3AlytnAtyD/LjsGXZOYVVBMOD0lWBirY+X7t4='
WHERE
key_id = '29825b8cbe2175da5b57ef1b258ee93b0f1b91e852d93445e08e3e391b3ea3b6'
AND (
token = 'knsT1z3AlytnAtyD/LjsGXZOYVVBMOD0lWBirY+X7t4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)