UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jiZHysc9aTewYrrvcxkDD344razoRy8yMhYhyZAc7No='
WHERE
key_id = '672ab2fd0504c5b1f31dba9454b2e4d11209acf1f28afbaf2f2eb477fa5baacf'
AND (
token = 'jiZHysc9aTewYrrvcxkDD344razoRy8yMhYhyZAc7No='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)