UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NMpI8eicIcz3pHt/LQPsV3f2DUICZEUqyLp+6VITUMQ='
WHERE
key_id = '2019468d6d2e618bcaf7d32d87d216bb4f3f8c691e7d6147bf39615e7872e019'
AND (
token = 'NMpI8eicIcz3pHt/LQPsV3f2DUICZEUqyLp+6VITUMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)