UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LpMrbqAc7RVbl8QuVg+b3qa8UKTCrKOEl//Vg25/d8I='
WHERE
key_id = 'acc20d1a3500cf97dc92cd527b9946ddbfaa93b29569e0596c36aed641b9945e'
AND (
token = 'LpMrbqAc7RVbl8QuVg+b3qa8UKTCrKOEl//Vg25/d8I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)