UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KkCxRnpGyc7vSY/yTuTRW1o6DcbpSZ+cQRXOXCv8g6A='
WHERE
key_id = '9c9d4babef406cee9868186cfe1215a5ad7676fb06a8ed8776e3ed4ebf0cd940'
AND (
token = 'KkCxRnpGyc7vSY/yTuTRW1o6DcbpSZ+cQRXOXCv8g6A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)