UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XNSSfmwolO1BkNv5L+zYEH3kpJYvF7UwB+Tk7rq2zD8='
WHERE
key_id = 'c556c5d301a31a68c696e6538e592370d9294c97bcb7ede1700e495361e8e059'
AND (
token = 'XNSSfmwolO1BkNv5L+zYEH3kpJYvF7UwB+Tk7rq2zD8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)