UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NXKlGV054rPVG+SoiTiDzQTtqy5tIkpLqNLFzt+jcFw='
WHERE
key_id = '0b332fc3722d9d7595c318f0d763afd3ece8db3f5c7fb29e6b20264ff492f1c9'
AND (
token = 'NXKlGV054rPVG+SoiTiDzQTtqy5tIkpLqNLFzt+jcFw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)