UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CYp/B6Kgh+7i8WzNCCHZZBjB5wvAuD9Le9OwmSbPXic=' 
WHERE 
  key_id = '7e1e86eb64cddc85764fa11c76740fc7ad253657ba512cb0c710665359e19969' 
  AND (
    token = 'CYp/B6Kgh+7i8WzNCCHZZBjB5wvAuD9Le9OwmSbPXic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041