UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jUAMhzjl+L1Rt2vCts7rywV9xxwXSzK0ne6CYSzQI1U='
WHERE
key_id = '26d99a961ed236deae0c33335908b1901e61e386f37bb7806382e99c65df28b5'
AND (
token = 'jUAMhzjl+L1Rt2vCts7rywV9xxwXSzK0ne6CYSzQI1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)