UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/nPDFgdvGyl5+R+3y6A3NghRO+kqpmBLxFCO2SjGlPo='
WHERE
key_id = '18be41dd6a082d2b088f2dbc24b649d0f4012280cec80cc75a06e1d0c281570d'
AND (
token = '/nPDFgdvGyl5+R+3y6A3NghRO+kqpmBLxFCO2SjGlPo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)