UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PnZQAK+fCmmjT0P/ChYHODC7isn2/kInl5BFvoO8Ubs='
WHERE
key_id = 'e75df28b069759001dfc1ab2c951101229dd7499a3dbd271178a58667e8e0107'
AND (
token = 'PnZQAK+fCmmjT0P/ChYHODC7isn2/kInl5BFvoO8Ubs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)