UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1nTsFZSBEUM9KkPE9Or3sqDT5DhtVUsCSEVolszUDbs='
WHERE
key_id = '6bdde5f798e8491d33c7fb24ddd2773d42b23368139d54fc7f211126cc25db57'
AND (
token = '1nTsFZSBEUM9KkPE9Or3sqDT5DhtVUsCSEVolszUDbs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)