UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sm44ZzTcwsPcN2ZRjlpZ83RhFhNjO3JGPkDT9YXqNbk='
WHERE
key_id = '71d684952809b85432b44074b1eff6521d80c48d3dfe4352d0b6f8ab5668c4f7'
AND (
token = 'sm44ZzTcwsPcN2ZRjlpZ83RhFhNjO3JGPkDT9YXqNbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)